package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum RedPacketTransportEnum {
    SEND("SEND"),
    RECEIVE("RECEIVE");

    private final String code;

    RedPacketTransportEnum(String code){
        this.code = code;
    }

    public static RedPacketTransportEnum byCode(String code) {
        for (RedPacketTransportEnum e: RedPacketTransportEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }

    public static boolean isSend(String code){
        return SEND.getCode().equalsIgnoreCase(code);
    }
    public static boolean isReceive(String code){
        return RECEIVE.getCode().equalsIgnoreCase(code);
    }
}
